package net.da.client.component;

import java.util.Map;

import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;

import net.da.client.common.component.ComponentImpl;

public class HomeComponent extends ComponentImpl {
	
	private Map initArgs;
	
	public void onInit(Map initArgs) {
		//can be overriden
		this.initArgs = initArgs;
	}
	
	public void onHide() {
	}

	public void onShow() {
		buildLayout();
	}

	private void buildLayout() {
		
		String authorizationCode = "";
		if (initArgs!= null) {
			authorizationCode = (String) initArgs.get("authorizationCode");
		}
		
		Panel root = getComponentRoot();
		root.clear();
		root.add(new Label("Home component"));
		root.add(new Label("Authorization code:" + authorizationCode));
	}

}
